package day07Test;

import java.util.Random;

public class Test5 {
    public static void main(String[] args) {
        Random r = new Random();
        int[] arr = new int[6];
        int sum = 0;
        System.out.println("评委打分:");
        for (int i = 0; i < 6; i++) {
            int randomIndex = r.nextInt(101);
            int num = randomIndex;
            System.out.print(" " + num + " ");
            arr[i] = randomIndex;
        }
        int max = arr[0];
        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            max = arr[i] > max ? max = arr[i] : max;
            min = arr[i] < min ? min = arr[i] : min;
        }
        for (int i = 0; i < 6; i++) {
            sum = sum + arr[i];
        }
        int number = (sum - max - min)/(arr.length-2);
        System.out.println();
        System.out.println("最高分为" + max);
        System.out.println("最低分为" + min);
        System.out.println("平均分为" + number);

    }
}
